package com.icss.struct.action;

import com.icss.struct.dao.SNSTagDao;
import com.icss.struct.dto.R;
import com.icss.struct.dto.Tag;

import java.util.HashMap;
import java.util.List;

public class SNSTagAction {

    public Object getTop10Tag(HashMap<String, String> param) {

        System.out.println("-------SNSTagAction@getTop10Tag----------------");
        SNSTagDao dao = new SNSTagDao();
        List<Tag> tlist = dao.findTop10();

//        R r = new R();
//        r.setCode(20000);
//        r.setMessage("success");
//        r.setData(tlist);
        return R.success(tlist);
    }

    public Object update(HashMap<String, String> param) {

        System.out.println("-------SNSTagAction@getTop10Tag----------------");
        SNSTagDao dao = new SNSTagDao();
        dao.updateById(param);
        List<Tag> tlist = dao.findTop10();
        return R.success(tlist);
    }
}
